<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script>
    /* 
    修改this指针的异同点
    1.apply
    2.call
    3.bind:直接在对象上绑定，改变this指向
     */
     
     var Student={
       name:"小王",
       like:function(){
         console.log(this.name+"钓鱼");
         for(var i=0;i<arguments.length;i++){
               console.log(arguments[i]);
         }
       }.bind(Teacher),
     }
     var Teacher={
       name:"老王",
     }
    //apply和call的不同：调用方式不一样,传值方式也不一样
     //Student.like.call(Teacher,"唱","跳","rap");
     //Student.like.apply(Teacher,["唱","跳","rap"]);
     Student.like("唱","跳","rap");
  </script>
</head>
<body>
  
</body>
</html>